package imv3.foo.client.console;

import imv3.protocol.request.QuitGroupRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author @xsomnus666_xiawenye★
 * @since 2019/4/26 0026 10:46
 * 当你发现自己的才华撑不起野心时，就请安静下来学习吧
 */
public class QuiteGroupConsoleCommand implements ConsoleCommand {

    @Override
    public void exec(Scanner scanner, Channel channel) {

        QuitGroupRequestPacket quitGroupRequestPacket = new QuitGroupRequestPacket();

        System.out.print("输入groupId, 退出群聊: ");
        String groupId = scanner.next();
        quitGroupRequestPacket.setGroupId(groupId);
        channel.writeAndFlush(quitGroupRequestPacket);
    }
}
